<ul class="sf-menu">
	<?php
		foreach($this->admin_menu as $k=>$v) {
			if($this->admin_info['permission'] === 'all') {
	?>
	<li<?php if($this->menu_value == $v['value'] || in_array($this->menu_value,$v['sub_menu']) || in_array($this->menu_value,$v['function'])) {$this->assign('tag_name',$k); echo ' class="current"';}  ?>><a href="<?php echo $v['value'] ?>"><?php echo $k ?></a></li>
	<?php
			}else {
				$permission = explode(',',$this->admin_info['permission']);
				if(in_array($v['value'],$permission) || count(array_intersect($permission,$v['sub_menu']))) {
					if(in_array($v['value'],$permission)) {
						$url = $v['value'];
					}
					if(count(array_intersect($permission,$v['sub_menu'])) > 0) {
						$url = array_intersect($permission,$v['sub_menu']);
						$url = current($url);
					}
	?>
	<li<?php if($this->menu_value == $v['value'] || in_array($this->menu_value,$v['sub_menu']) || in_array($this->menu_value,$v['function'])) {$this->assign('tag_name',$k); echo ' class="current"';}  ?>><a href="<?php echo $url ?>"><?php echo $k ?></a></li>
	<?php  
				}else {
					$temp_c = explode('/',$v['value']);
					$temp_c = $temp_c[0];
					if($this->permissionConfig['controllers'][$temp_c]['allow'] == 'all') {
	?>
	<li<?php if($this->menu_value == $v['value'] || in_array($this->menu_value,$v['sub_menu']) || in_array($this->menu_value,$v['function'])) {$this->assign('tag_name',$k); echo ' class="current"';}  ?>><a href="<?php echo $v['value'] ?>"><?php echo $k ?></a></li>
	<?php 
					}
				}
			}
		}
	?>
</ul>